<html>
<head><meta charset="utf-8"><title>Unify `TyS` and `PrimTy`? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Unify.20.60TyS.60.20and.20.60PrimTy.60.3F.html">Unify `TyS` and `PrimTy`?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="209464944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Unify%20%60TyS%60%20and%20%60PrimTy%60%3F/near/209464944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Unify.20.60TyS.60.20and.20.60PrimTy.60.3F.html#209464944">(Sep 09 2020 at 02:02)</a>:</h4>
<p>I just noticed that they both have the same variants:</p>
<div class="codehilite"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">enum</span> <span class="nc">TyKind</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">Bool</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">Char</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">Int</span><span class="p">(</span><span class="n">IntTy</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Uint</span><span class="p">(</span><span class="n">UintTy</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Float</span><span class="p">(</span><span class="n">FloatTy</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Str</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="o">..</span><span class="p">.</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">enum</span> <span class="nc">PrimTy</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">Int</span><span class="p">(</span><span class="n">IntTy</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Uint</span><span class="p">(</span><span class="n">UintTy</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Float</span><span class="p">(</span><span class="n">FloatTy</span><span class="p">),</span><span class="w"></span>
<span class="w">    </span><span class="n">Str</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">Bool</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">Char</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<p>Is there any interest in combining these? I was going to just make a PR but it caused 200 compile errors <span aria-label="cry" class="emoji emoji-1f622" role="img" title="cry">:cry:</span> so I thought I'd ask if it's actually useful before I fix them all</p>



<a name="209465015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Unify%20%60TyS%60%20and%20%60PrimTy%60%3F/near/209465015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Unify.20.60TyS.60.20and.20.60PrimTy.60.3F.html#209465015">(Sep 09 2020 at 02:04)</a>:</h4>
<p>(link so I don't forget what branch it's on: <a href="https://github.com/rust-lang/rust/commit/98711ff754a84ada37c369100302fb3c13616c6b">https://github.com/rust-lang/rust/commit/98711ff754a84ada37c369100302fb3c13616c6b</a>)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>